﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace EventLogAdmin
{
    public partial class InputBox : Form
    {
        public InputBox()
        {
            InitializeComponent();
        }

        public string Prompt 
        {
            get { return lblPrompt.Text; }
            set { lblPrompt.Text = value; } 
        }
        public string SelectedText
        {
            get { return txtInput.Text; }
            set { txtInput.Text = value; }
        }

        private void txtInput_KeyPress(object sender, KeyPressEventArgs e)
        {
            //if (e.KeyChar == '\r')
            //{
            //    e.Handled = true;
            //    DialogResult = System.Windows.Forms.DialogResult.OK;
            //    Close();
            //}
            if (e.KeyChar == char.ConvertFromUtf32(27).ToCharArray()[0])
            {
                e.Handled = true;
                DialogResult = System.Windows.Forms.DialogResult.OK;
                Close();
            }
        }

    }
}
